[skipci] [Doctest] added contrib metrics AveragePrecision, PrecisionRecallCurve, ROC_AUC and RocCurve#2341
Merged
sdesrozis merged 6 commits intopytorch:masterfrom Dec 6, 2021
Merged
Conversation
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
sdesrozis
reviewed
Dec 5, 2021
Contributor
|
@Ishan-Kumar2 Thanks a lot for your help ! I left some minor comments. |
sdesrozis
reviewed
Dec 5, 2021
|
|
||
| avg_precision = AveragePrecision(activated_output_transform) | ||
| avg_precision = AveragePrecision() | ||
| #The ``output_transform`` arg of the metric can be used to perform a softmax on the ``y_pred``. |
Contributor
There was a problem hiding this comment.
Thinking about it, it is worth to keep the current example to show the way to respect the data format, maybe as a note or an example following the one you did. What do you think ?
Note:
AveragePrecision expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or confidence values. To apply an activation to y_pred, use output_transform as shown below:
.. code-block:: python
def activated_output_transform(output):
y_pred, y = output
y_pred = torch.softmax(y_pred, dim=1)
return y_pred, y
avg_precision = AveragePrecision(activated_output_transform)
Contributor
Author
There was a problem hiding this comment.
Yup, makes sense to have it in the docs somewhere, I have added it now!
sdesrozis
approved these changes
Dec 6, 2021
Contributor
sdesrozis
left a comment
There was a problem hiding this comment.
@Ishan-Kumar2 Thank you ! LGTM
51 tasks
Ishan-Kumar2
added a commit
to Ishan-Kumar2/ignite
that referenced
this pull request
Dec 26, 2021
…isionRecallCurve``, ``ROC_AUC`` and ``RocCurve`` (pytorch#2341)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #2265
Description:
added doctests for contrib metrics
AveragePrecision,PrecisionRecallCurve,ROC_AUCandRocCurveNot sure about the list of floats outputs, please let me know if there is a better way to handle those.
@ydcjeff @sdesrozis
Check list: